package com.example.demo69.service;

import com.example.demo69.dao.UserDao;
import com.example.demo69.entity.User;
import com.example.demo69.vo.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {

    @Autowired
    UserDao userDao;

    public List<User> queryUserList(PageInfo pageInfo){
        return userDao.queryUserList((pageInfo.getPageNum() - 1)* pageInfo.getPageSize(), pageInfo.getPageSize());
    }

    public void insert(User user){
        userDao.insert(user);
    }

    public void delete(int id){
        userDao.delete(id);
    }

    public void update(User user){
        userDao.update(user);
    }
}
